<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demo/owner/owner.jsx此处编写
 -->
<template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
        :table="table" :extend="extend">
    </view-grid>
</template>
<script>
import extend from "@/extension/demo/owner/owner.jsx";
import { ref, defineComponent } from "vue";
export default defineComponent({
    setup() {
        const table = ref({
            key: 'OwnerId',
            footer: "Foots",
            cnName: '货主表',
            name: 'owner/owner',
            url: "/basicinformation/api/owner/",
            sortName: "CreateDate"
        });
        const editFormFields = ref({ "OwnerName": "", "OwnerPhone": "", "FlatsName": "", "OwnerAddr": "", "DrivingDate": "", "OwnerContent": "", "DrivingImg": "" });
        const editFormOptions = ref([[{ "title": "货主姓名", "required": true, "field": "OwnerName", "type": "text" }],
        [{ "title": "手机号", "required": true, "field": "OwnerPhone", "type": "text" }],
        [{ "title": "单位名称", "required": true, "field": "FlatsName", "type": "text" }],
        [{ "title": "联系地址", "required": true, "field": "OwnerAddr", "type": "text" }],
        [{ "title": "驾驶证有效日期", "required": true, "field": "DrivingDate", "type": "datetime" }],
        [{ "title": "备注", "field": "OwnerContent", "type": "textarea" }],
        [{ "title": "驾驶证照片", "field": "DrivingImg", "type": "img" }]]);
        const searchFormFields = ref({ "OwnerName": "", "OwnerPhone": "", "DrivingDate": "" });
        const searchFormOptions = ref([[{ "title": "货主姓名", "field": "OwnerName", "type": "like" }, { "title": "手机号", "field": "OwnerPhone", "type": "like" }], [{ "title": "驾驶证有效日期", "field": "DrivingDate", "type": "date" }]]);
        const columns = ref([{ field: 'OwnerId', title: '货主ID', type: 'string', width: 110, hidden: true, readonly: true, require: true, align: 'left' },
        { field: 'OwnerName', title: '货主姓名', type: 'string', width: 110, require: true, align: 'left', sort: true },
        { field: 'OwnerPhone', title: '手机号', type: 'string', width: 110, require: true, align: 'left' },
        { field: 'FlatsName', title: '单位名称', type: 'string', width: 170, require: true, align: 'left' },
        { field: 'OwnerAddr', title: '联系地址', type: 'string', width: 150, require: true, align: 'left' },
        { field: 'DrivingDate', title: '驾驶证有效日期', type: 'date', width: 150, require: true, align: 'left', sort: true },
        { field: 'OwnerContent', title: '备注', type: 'string', width: 120, align: 'left' },
        { field: 'DrivingImg', title: '驾驶证照片', type: 'img', width: 120, align: 'left' },
        { field: 'CreateName', title: '创建人', type: 'string', width: 110, hidden: true, align: 'left' },
        { field: 'CreateDate', title: '创建时间', type: 'datetime', width: 150, align: 'left', sort: true },
        { field: 'UpdateName', title: '修改人', type: 'string', width: 110, hidden: true, align: 'left' },
        { field: 'UpdateTime', title: '修改时间', type: 'datetime', width: 150, hidden: true, align: 'left', sort: true },
        { field: 'IsDel', title: '逻辑删除', type: 'int', width: 110, hidden: true, align: 'left' }]);
        const detail = ref({
            cnName: "#detailCnName",
            table: "#detailTable",
            columns: [],
            sortName: "",
            key: ""
        });
        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
        };
    },
});
</script>
